home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / A / Alpha.5.05.cpt / shell.tcl < prev   
MacBinary  |  1992-09-06  |  2.0 KB  |  [TEXT/ALFA]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: shell.tcl

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Sep 6 08:52:44 1992, modified Sun Sep 6 08:52:44 1992, creator Alpha editor, type ASCII, 1498 bytes "shell.tcl" , at 0x65a 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ALFA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 73 68 65 6c 6c 2e | 74 63 6c 00 00 00 00 00 |..shell.|tcl.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 41 4c 46 | 41 01 00 00 00 00 00 00 |.TEXTALF|A.......|
|00000050| 00 00 00 00 00 05 da 00 | 00 01 7e a6 cf af 9c a6 |........|..~.....|
|00000060| cf af 9c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 3d dd 00 00 |........|....=...|
|00000080| 0d 70 72 6f 63 20 69 6e | 69 74 53 68 65 6c 6c 20 |.proc in|itShell |
|00000090| 7b 7d 20 7b 0d 09 69 6e | 73 65 72 74 54 65 78 74 |{} {..in|sertText|
|000000a0| 20 22 57 65 6c 63 6f 6d | 65 20 74 6f 20 41 6c 70 | "Welcom|e to Alp|
|000000b0| 68 61 27 73 20 54 63 6c | 20 73 68 65 6c 6c 2e 22 |ha's Tcl| shell."|
|000000c0| 0d 09 73 68 65 6c 6c 50 | 72 6f 6d 70 74 20 5b 6c |..shellP|rompt [l|
|000000d0| 69 6e 64 65 78 20 5b 77 | 69 6e 4e 61 6d 65 73 5d |index [w|inNames]|
|000000e0| 20 30 5d 0d 7d 0d 0d 23 | 20 4f 75 74 70 75 74 20 | 0].}..#| Output |
|000000f0| 74 68 65 20 70 72 6f 6d | 70 74 2e 20 57 65 20 77 |the prom|pt. We w|
|00000100| 61 6e 74 20 74 68 65 20 | 77 69 6e 64 6f 77 20 6e |ant the |window n|
|00000110| 61 6d 65 20 62 65 63 61 | 75 73 65 20 73 6f 6d 65 |ame beca|use some|
|00000120| 20 6f 66 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 73 | of the |commands|
|00000130| 0d 23 20 77 65 20 65 76 | 61 6c 75 61 74 65 20 28 |.# we ev|aluate (|
|00000140| 73 75 63 68 20 61 73 20 | 27 65 64 69 74 27 29 20 |such as |'edit') |
|00000150| 6f 70 65 6e 20 61 20 6e | 65 77 20 77 69 6e 64 6f |open a n|ew windo|
|00000160| 77 2c 20 61 6e 64 20 77 | 65 20 77 61 6e 74 20 74 |w, and w|e want t|
|00000170| 68 65 20 69 6e 73 65 72 | 74 69 6f 6e 0d 23 20 74 |he inser|tion.# t|
|00000180| 6f 20 62 65 20 64 6f 6e | 65 20 69 6e 20 74 68 65 |o be don|e in the|
|00000190| 20 73 68 65 6c 6c 20 77 | 69 6e 64 6f 77 2e 0d 70 | shell w|indow..p|
|000001a0| 72 6f 63 20 73 68 65 6c | 6c 50 72 6f 6d 70 74 20 |roc shel|lPrompt |
|000001b0| 7b 77 69 6e 4e 61 6d 65 | 7d 20 7b 0d 09 72 65 67 |{winName|} {..reg|
|000001c0| 65 78 70 20 22 28 5c 5b | 5e 3a 5c 5d 2a 29 3a 24 |exp "(\[|^:\]*):$|
|000001d0| 22 20 5b 70 77 64 5d 20 | 63 72 44 75 6d 20 63 72 |" [pwd] |crDum cr|
|000001e0| 44 69 72 0d 09 69 6e 73 | 65 72 74 54 65 78 74 20 |Dir..ins|ertText |
|000001f0| 2d 77 20 24 77 69 6e 4e | 61 6d 65 20 22 5c 72 22 |-w $winN|ame "\r"|
|00000200| 20 24 63 72 44 69 72 20 | 22 3e 20 22 0d 7d 0d 0d | $crDir |"> ".}..|
|00000210| 0d 23 20 43 61 6c 6c 65 | 64 20 61 74 20 61 6c 6c |.# Calle|d at all|
|00000220| 20 63 61 72 72 69 61 67 | 65 20 72 65 74 75 72 6e | carriag|e return|
|00000230| 73 2e 0d 70 72 6f 63 20 | 63 61 72 72 69 61 67 65 |s..proc |carriage|
|00000240| 52 65 74 75 72 6e 20 7b | 7d 20 7b 0d 09 67 6c 6f |Return {|} {..glo|
|00000250| 62 61 6c 20 6d 6f 64 65 | 0d 09 73 65 74 20 69 6e |bal mode|..set in|
|00000260| 64 65 6e 74 53 74 72 69 | 6e 67 20 22 22 0d 09 64 |dentStri|ng ""..d|
|00000270| 65 6c 65 74 65 54 65 78 | 74 20 5b 67 65 74 50 6f |eleteTex|t [getPo|
|00000280| 73 5d 20 5b 73 65 6c 45 | 6e 64 5d 0d 09 69 66 20 |s] [selE|nd]..if |
|00000290| 7b 5b 67 65 74 56 61 72 | 20 69 6e 64 65 6e 74 4f |{[getVar| indentO|
|000002a0| 6e 43 52 5d 7d 20 7b 0d | 09 09 73 65 74 20 70 6f |nCR]} {.|..set po|
|000002b0| 73 20 5b 67 65 74 50 6f | 73 5d 0d 09 09 73 65 74 |s [getPo|s]...set|
|000002c0| 20 74 65 78 74 20 5b 67 | 65 74 54 65 78 74 20 5b | text [g|etText [|
|000002d0| 6c 69 6e 65 53 74 61 72 | 74 20 24 70 6f 73 5d 20 |lineStar|t $pos] |
|000002e0| 24 70 6f 73 5d 0d 09 09 | 66 6f 72 20 7b 73 65 74 |$pos]...|for {set|
|000002f0| 20 69 20 30 3b 20 73 65 | 74 20 6c 65 6e 20 5b 73 | i 0; se|t len [s|
|00000300| 74 72 69 6e 67 20 6c 65 | 6e 67 74 68 20 24 74 65 |tring le|ngth $te|
|00000310| 78 74 5d 7d 20 7b 24 69 | 20 3c 3d 20 24 6c 65 6e |xt]} {$i| <= $len|
|00000320| 7d 20 7b 69 6e 63 72 20 | 69 7d 20 7b 0d 09 09 09 |} {incr |i} {....|
|00000330| 73 65 74 20 63 20 5b 73 | 74 72 69 6e 67 20 69 6e |set c [s|tring in|
|00000340| 64 65 78 20 24 74 65 78 | 74 20 24 69 5d 0d 09 09 |dex $tex|t $i]...|
|00000350| 09 69 66 20 7b 28 24 63 | 20 21 3d 20 22 5c 74 22 |.if {($c| != "\t"|
|00000360| 29 20 26 26 20 28 24 63 | 20 21 3d 20 22 5c 20 22 |) && ($c| != "\ "|
|00000370| 29 7d 20 7b 0d 09 09 09 | 09 73 65 74 20 69 6e 64 |)} {....|.set ind|
|00000380| 65 6e 74 53 74 72 69 6e | 67 20 5b 73 74 72 69 6e |entStrin|g [strin|
|00000390| 67 20 72 61 6e 67 65 20 | 24 74 65 78 74 20 30 20 |g range |$text 0 |
|000003a0| 5b 65 78 70 72 20 24 69 | 2d 31 5d 5d 0d 09 09 09 |[expr $i|-1]]....|
|000003b0| 09 62 72 65 61 6b 0d 09 | 09 09 7d 0d 09 09 7d 0d |.break..|..}...}.|
|000003c0| 09 7d 0d 09 69 6e 73 65 | 72 74 54 65 78 74 20 22 |.}..inse|rtText "|
|000003d0| 5c 72 22 20 24 69 6e 64 | 65 6e 74 53 74 72 69 6e |\r" $ind|entStrin|
|000003e0| 67 0d 7d 0d 0d 0d 70 72 | 6f 63 20 74 63 6c 43 61 |g.}...pr|oc tclCa|
|000003f0| 72 72 69 61 67 65 52 65 | 74 75 72 6e 20 7b 7d 20 |rriageRe|turn {} |
|00000400| 7b 0d 09 67 6c 6f 62 61 | 6c 20 6d 6f 64 65 0d 09 |{..globa|l mode..|
|00000410| 75 70 6c 65 76 65 6c 20 | 23 30 20 7b 0d 09 09 73 |uplevel |#0 {...s|
|00000420| 65 74 20 6f 6c 64 46 6f | 72 20 5b 67 65 74 56 61 |et oldFo|r [getVa|
|00000430| 72 20 66 6f 72 77 61 72 | 64 5d 0d 09 09 73 65 74 |r forwar|d]...set|
|00000440| 20 6f 6c 64 52 65 67 20 | 5b 67 65 74 56 61 72 20 | oldReg |[getVar |
|00000450| 72 65 67 45 78 70 72 5d | 0d 09 09 73 65 74 20 6f |regExpr]|...set o|
|00000460| 6c 64 4d 61 74 63 68 20 | 5b 67 65 74 56 61 72 20 |ldMatch |[getVar |
|00000470| 6d 61 74 63 68 57 6f 72 | 64 73 5d 0d 09 09 73 65 |matchWor|ds]...se|
|00000480| 74 20 66 69 6c 65 4e 61 | 6d 65 20 5b 6c 69 6e 64 |t fileNa|me [lind|
|00000490| 65 78 20 5b 77 69 6e 4e | 61 6d 65 73 5d 20 30 5d |ex [winN|ames] 0]|
|000004a0| 0d 09 09 73 65 74 56 61 | 72 20 66 6f 72 77 61 72 |...setVa|r forwar|
|000004b0| 64 20 30 0d 09 09 73 65 | 74 56 61 72 20 72 65 67 |d 0...se|tVar reg|
|000004c0| 45 78 70 72 20 30 0d 09 | 09 73 65 74 56 61 72 20 |Expr 0..|.setVar |
|000004d0| 6d 61 74 63 68 57 6f 72 | 64 73 20 30 0d 09 09 67 |matchWor|ds 0...g|
|000004e0| 6f 74 6f 20 5b 6d 61 78 | 50 6f 73 5d 0d 09 09 73 |oto [max|Pos]...s|
|000004f0| 65 74 20 63 72 54 65 78 | 74 20 5b 67 65 74 54 65 |et crTex|t [getTe|
|00000500| 78 74 20 5b 65 78 70 72 | 20 22 5b 6c 69 6e 64 65 |xt [expr| "[linde|
|00000510| 78 20 5b 73 65 61 72 63 | 68 20 22 3e 22 20 5b 6d |x [searc|h ">" [m|
|00000520| 61 78 50 6f 73 5d 5d 20 | 30 5d 2b 32 22 5d 20 5b |axPos]] |0]+2"] [|
|00000530| 6d 61 78 50 6f 73 5d 5d | 0d 09 09 63 61 74 63 68 |maxPos]]|...catch|
|00000540| 20 24 63 72 54 65 78 74 | 20 63 72 52 65 73 0d 09 | $crText| crRes..|
|00000550| 09 69 66 20 7b 5b 73 74 | 72 69 6e 67 20 6c 65 6e |.if {[st|ring len|
|00000560| 67 74 68 20 24 63 72 52 | 65 73 5d 7d 20 7b 0d 09 |gth $crR|es]} {..|
|00000570| 09 09 69 6e 73 65 72 74 | 54 65 78 74 20 2d 77 20 |..insert|Text -w |
|00000580| 24 66 69 6c 65 4e 61 6d | 65 20 22 5c 72 22 20 24 |$fileNam|e "\r" $|
|00000590| 63 72 52 65 73 0d 09 09 | 7d 20 0d 09 09 73 68 65 |crRes...|} ...she|
|000005a0| 6c 6c 50 72 6f 6d 70 74 | 20 24 66 69 6c 65 4e 61 |llPrompt| $fileNa|
|000005b0| 6d 65 0d 09 09 73 65 74 | 56 61 72 20 66 6f 72 77 |me...set|Var forw|
|000005c0| 61 72 64 20 24 6f 6c 64 | 46 6f 72 0d 09 09 73 65 |ard $old|For...se|
|000005d0| 74 56 61 72 20 72 65 67 | 45 78 70 72 20 24 6f 6c |tVar reg|Expr $ol|
|000005e0| 64 52 65 67 0d 09 09 73 | 65 74 56 61 72 20 6d 61 |dReg...s|etVar ma|
|000005f0| 74 63 68 57 6f 72 64 73 | 20 24 6f 6c 64 4d 61 74 |tchWords| $oldMat|
|00000600| 63 68 0d 09 7d 0d 7d 0d | 62 69 6e 64 20 27 5c 72 |ch..}.}.|bind '\r|
|00000610| 27 20 63 61 72 72 69 61 | 67 65 52 65 74 75 72 6e |' carria|geReturn|
|00000620| 0d 62 69 6e 64 20 27 5c | 72 27 20 74 63 6c 43 61 |.bind '\|r' tclCa|
|00000630| 72 72 69 61 67 65 52 65 | 74 75 72 6e 20 22 43 73 |rriageRe|turn "Cs|
|00000640| 68 22 0d 0d 23 09 74 63 | 6c 43 61 72 72 69 61 67 |h"..#.tc|lCarriag|
|00000650| 65 52 65 74 75 72 6e 0d | 0d 0d 00 00 00 00 00 00 |eReturn.|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000680| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00000690| 02 1c 02 1e 82 2e 82 2e | 82 2e 82 2e 82 2e 82 2e |........|........|
|000006a0| 82 2e 82 2e 82 2e 82 2e | 82 2e 82 2e 82 2e 02 2e |........|........|
|000006b0| 09 73 68 65 6c 6c 2e 74 | 63 6c 02 00 00 00 54 45 |.shell.t|cl....TE|
|000006c0| 58 54 41 4c 46 41 01 00 | 00 10 23 be 00 00 00 00 |XTALFA..|..#.....|
|000006d0| 00 00 54 45 58 54 41 4c | 46 41 01 00 00 10 23 be |..TEXTAL|FA....#.|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 a6 65 8d 98 00 00 | 05 da 00 00 01 7e 83 2c |...e....|.....~.,|
|00000700| 03 2c 03 38 83 40 03 40 | 03 58 83 5e 03 5e 83 7e |.,.8.@.@|.X.^.^.~|
|00000710| 03 7e 03 94 83 9a 83 9a | 83 9a 03 9a 83 c2 83 c2 |.~......|........|
|00000720| 03 c2 03 d8 83 de 83 de | 03 de 84 10 84 10 04 10 |........|........|
|00000730| 04 26 84 2c 84 2c 04 2c | 84 50 84 50 04 50 04 66 |.&.,.,.,|.P.P.P.f|
|00000740| 84 6c 84 6c 04 6c 84 9c | 84 9c 04 9c 04 b2 84 b8 |.l.l.l..|........|
|00000750| 84 b8 04 b8 84 c4 84 c4 | 84 c4 84 c4 04 c4 04 da |........|........|
|00000760| 85 0a 85 0a 05 0a 05 20 | 05 32 85 36 05 36 05 46 |....... |.2.6.6.F|
|00000770| 85 5c 05 5c 05 5e 85 6e | 85 6e 85 6e 85 6e 85 6e |.\.\.^.n|.n.n.n.n|
|00000780| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 94 00 00 |...H..Mo|naco....|
|00000790| 00 00 00 00 00 00 00 00 | 00 6b 00 67 e0 6e 00 68 |........|.k.g.n.h|
|000007a0| 34 56 00 00 00 00 00 04 | 00 04 00 4c 00 10 01 d6 |4V......|...L....|
|000007b0| 02 40 00 4c 00 10 01 d6 | 02 40 00 02 3e 5d 00 00 |.@.L....|.@..>]..|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|000007d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 58 e3 20 |...L...L|...2.X. |
|000007e0| 06 9e 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|000007f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 59 7c 54 00 00 |........|...Y|T..|
+--------+-------------------------+-------------------------+--------+--------+